#ifndef LABELMANAGER_H
#define LABELMANAGER_H

#include <QLabel>
#include <QMap>

using namespace std;

class LabelManager
{
private:
    QMap<int, QLabel*> labels;
    static LabelManager manager;

public:

    // adds a label
    void addLabel(QLabel* l, int id) { labels[id] = l; }

    // returns a label with <id>, or NULL if none
    QLabel* getById(int id) { return labels[id]; }

    // returns <labels>
    QMap<int, QLabel*>& getLabels() { return labels; }

    // Removes label with <id>
    void destroyById(int id);

    // Resets manager
    void reset();

    // returns a reference to <manager>
    static LabelManager& getManager() { return manager; }

    // Destroy objects
    ~LabelManager() { }
};

#endif // LABELMANAGER_H
